import requests

# 安装 pip install requests 2.19

url = "https://db.yaozh.com/"

# 添加请求头
headers = {
    'User-Agent': "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"
}

response = requests.get(url,headers=headers)

# 1.text 字符串str
data = response.text

# 2.content bytes
data = response.content.decode('utf-8')


with open('01get.html','w', encoding='utf-8') as f:
    f.write(data)

print(response)